//Source file: D:\\test\\com\\ce\\pms\\charge\\model\\ChargeStaDomain.java

package com.ce.pms.charge.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Where;

import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:收费标准 关联数据表:FEE_CHAR_STA
 */
@Entity
@Table(name = "FEE_CHAR_STA")
public class ChargeStaDomain implements IDomainObject{

	/**
	 * 关键字
	 */
	@Id
	@GeneratedValue
	@Column(name = "CHARGE_STA_ID")
	private Long keyword;

	/**
	 * 收费项目
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHARGE_ITEM_ID")
	private ChargeItemDomain chargeItem;

	/**
	 * 标准名称
	 */
	@Column(name = "STA_NAME", nullable = false, length = 50)
	private String staName;

	/**
	 * 当前标准:statuz=002 检索策略:lazy=false 级联配置:cascade=all-delete-orphan
	 */
	@OneToOne(cascade={CascadeType.ALL}, fetch = FetchType.EAGER, mappedBy="chargeSta")
	@Where(clause="STATUZ='002'")
	private AbstractStaVersion cVersion;

	/**
	 * 历史版本:statuz=001 检索策略:lazy=true 级联配置:cascade=all-delete-orphan
	 */
	@OneToMany(cascade={CascadeType.ALL}, fetch = FetchType.LAZY, mappedBy="chargeSta")
	@Where(clause="STATUZ='001'")
	private Set<AbstractStaVersion> hisVersions = new HashSet<AbstractStaVersion>();


	/**
	 * @roseuid 48757D12001F
	 */
	public ChargeStaDomain() {
	}

	/**
	 * mini constructor
	 * @param chargeItem 收费项目
	 * @param staName    标准名称
	 */
	public ChargeStaDomain(ChargeItemDomain chargeItem, String staName) {
		super();
		this.chargeItem = chargeItem;
		this.staName = staName;
	}

	public ChargeItemDomain getChargeItem() {
		return chargeItem;
	}

	public void setChargeItem(ChargeItemDomain chargeItem) {
		this.chargeItem = chargeItem;
	}

	public AbstractStaVersion getCVersion() {
		return cVersion;
	}

	public void setCVersion(AbstractStaVersion version) {
		cVersion = version;
	}

	public Set<AbstractStaVersion> getHisVersions() {
		return hisVersions;
	}

	public void setHisVersions(Set<AbstractStaVersion> hisVersions) {
		this.hisVersions = hisVersions;
	}

	public Long getKeyword() {
		return keyword;
	}

	public void setKeyword(Long keyword) {
		this.keyword = keyword;
	}

	public String getStaName() {
		return staName;
	}

	public void setStaName(String staName) {
		this.staName = staName;
	}



}
